Sub oracleTest()
    Dim cn As ADODB.Connection
    Dim str As String
    Dim ts As Tasks
    Dim t As Task
    
    ' set connection and task variables
    Set cn = New ADODB.Connection
    Set ts = ActiveProject.Tasks
    
    str = "Provider = MSDAORA.1;Password=" & "lisro" & _
                     ";User ID=" & "lisro" & ";Data Source=" & "fanying" & ";Persist Security Info=True"
    
    cn.Open str
    
    n = 0
    
    fyc = 0
    
    For Each t In ts
        If Not t Is Nothing Then
            
         ' insert into oracle
          a = Split(t.WBS, ".")
            
            
                       
           Ln = UBound(a) - LBound(a)
            
            
            
           If t.Name <> "" Then
                If Ln = 0 Then
                     If Asc(Mid(t.Name, 1, 1)) < 0 Then
                         ID = 0
                     Else
                         ID = Mid(t.Name, 1, 4)
                     End If
                     
                     
                            If Asc(Mid(t.Name, 1, 1)) < 0 Then
                              
                              ' MsgBox t.WBS & t.Name
                            End If
                End If
                    
           End If
           
           indexT = Array(0, 0, 0, 0, 0, 0, 0)
           
           
            For ii = 0 To Ln
                If Ln = 0 Then
                    indexT(0) = a(0)
                Else
                    indexT(ii) = a(ii)
                End If
                
                
            Next ii
            
        
        End If
        n = n + 1
        
    Next t
    
    
End Sub
